Work around a wayland crash
authorMatthias Clasen <mclasen@redhat.com>
Thu, 30 Mar 2017 13:14:05 +0000 (09:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 30 Mar 2017 13:15:29 +0000 (09:15 -0400)
For some reason, we are seeing damage being NULL here.
While that should never be the case, crashing on it is
unkind and makes the Wayland experience unusable.

gdk/wayland/gdkglcontext-wayland.c

index 82233cfb20bec6b9662879fd4a8bca9ccd81fdfb..7f74a34f94c447506446a60e35f77cb23262b329 100644 (file)
@@ -221,7 +221,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
   egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
                                                     context_wayland->egl_config);
 
-  if (display_wayland->have_egl_swap_buffers_with_damage)
+  if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL)
     {
       int i, j, n_rects = cairo_region_num_rectangles (damage);
       EGLint *rects = g_new (EGLint, n_rects * 4);